﻿using System.Data.Entity.ModelConfiguration;

namespace HobSoft.SoccerBet2014.Domain.Models.DbSchema
{
    public class OddsConfiguration : EntityTypeConfiguration<Odds>
    {
        public OddsConfiguration(string schema = "dbo")
        {
            ToTable(schema + ".OddsList");
            HasKey(o => new { o.BmID, o.OddsID });

            Property(o => o.BmID).HasColumnName("BookerID").IsRequired();
            Property(o => o.OddsID).HasColumnName("OddsID").IsRequired().HasMaxLength(50).IsUnicode(false);
            Property(o => o.GameID).HasColumnName("GameID").IsRequired().HasMaxLength(50).IsUnicode(false);
            Property(o => o.Handicap).HasColumnName("Handicap").IsRequired();
            Property(o => o.Type).HasColumnName("OddsType").IsRequired();
            Property(o => o.LastUpdateTime).HasColumnName("LastUpdateTime").IsOptional();
            Property(o => o.IsLive).HasColumnName("IsLive").IsOptional();
            Property(o => o.IsAvailable).HasColumnName("IsAvailable").IsOptional();
            //Ignore(o => o.Prices);
            Ignore(o => o.Key);
        }
    }
}
